/**
 * 
 */
package com.newtribe.security.cert.config;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.FileSystemXmlApplicationContext;

/**
 * @author newtribe
 *
 */
public class CertConfig implements Serializable{

	
	private DnName subjectDN ;
		
	private Date notBefore ;
	
	private Date notAfter;
	
	private SerialNumber serialNumber ;
	
	private String signatureAlgorithm;
	
	private String keygenAlgorithm;

	
	private int keysize ;
	
	private int expiresMonth;
	
	private CertConfig parent ; //父证书
	
	private List <ExtentionItem> extension ;//扩展项
	
	private boolean selfSign ;//是否自签名

	
	
	/**
	 * @return the keygenAlgorithm
	 */
	public String getKeygenAlgorithm() {
		return keygenAlgorithm;
	}



	/**
	 * @param keygenAlgorithm the keygenAlgorithm to set
	 */
	public void setKeygenAlgorithm(String keygenAlgorithm) {
		this.keygenAlgorithm = keygenAlgorithm;
	}



	/**
	 * @return the expiresMonth
	 */
	public int getExpiresMonth() {
		return expiresMonth;
	}



	/**
	 * @param expiresMonth the expiresMonth to set
	 */
	public void setExpiresMonth(int expiresMonth) {
		this.expiresMonth = expiresMonth;
	}



	/**
	 * @return the keysize
	 */
	public int getKeysize() {
		return keysize;
	}



	/**
	 * @param keysize the keysize to set
	 */
	public void setKeysize(int keysize) {
		this.keysize = keysize;
	}



	/**
	 * @return the subjectDN
	 */
	public DnName getSubjectDN() {
		return subjectDN;
	}



	/**
	 * @param subjectDN the subjectDN to set
	 */
	public void setSubjectDN(DnName subjectDN) {
		this.subjectDN = subjectDN;
	}






	/**
	 * @return the notBefore
	 */
	public Date getNotBefore() {
		return notBefore;
	}



	/**
	 * @param notBefore the notBefore to set
	 */
	public void setNotBefore(Date notBefore) {
		this.notBefore = notBefore;
	}



	/**
	 * @return the notAfter
	 */
	public Date getNotAfter() {
		return notAfter;
	}



	/**
	 * @param notAfter the notAfter to set
	 */
	public void setNotAfter(Date notAfter) {
		this.notAfter = notAfter;
	}



	/**
	 * @return the serialNumber
	 */
	public SerialNumber getSerialNumber() {
		return serialNumber;
	}



	/**
	 * @param serialNumber the serialNumber to set
	 */
	public void setSerialNumber(SerialNumber serialNumber) {
		this.serialNumber = serialNumber;
	}



	/**
	 * @return the signatureAlgorithm
	 */
	public String getSignatureAlgorithm() {
		return signatureAlgorithm;
	}



	/**
	 * @param signatureAlgorithm the signatureAlgorithm to set
	 */
	public void setSignatureAlgorithm(String signatureAlgorithm) {
		this.signatureAlgorithm = signatureAlgorithm;
	}



	/**
	 * @return the parent
	 */
	public CertConfig getParent() {
		return parent;
	}



	/**
	 * @param parent the parent to set
	 */
	public void setParent(CertConfig parent) {
		this.parent = parent;
	}



	/**
	 * @return the extension
	 */
	public List<ExtentionItem> getExtension() {
		return extension;
	}



	/**
	 * @param extension the extension to set
	 */
	public void setExtension(List<ExtentionItem> extension) {
		this.extension = extension;
	}



	public boolean isSelfSign() {
		return selfSign;
	}



	public void setSelfSign(boolean selfSign) {
		this.selfSign = selfSign;
	}



	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		 String[] path={"E:/TEMP/applicationContext.xml"
		
				 }; 
		 ApplicationContext context = new FileSystemXmlApplicationContext(path);
		 CertConfig config = (CertConfig)context.getBean("certconfig");
		 System.out.println(config);

	}
	
	

}
